<template>
  <view :style="themeColor">
    <view class="page">
      <view class="flex align-stretch benben-position-layout flex recommendCommodityList_flex_0"
        :style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
        <view class='flex align-center flex-sub recommendCommodityList_fd0_0'>
          <view class='flex align-center' @tap.stop="handleJumpDiy" data-type="back" data-url="1">
            <text class='fu-iconfont2  recommendCommodityList_fd0_0_c0_c0'>&#xE794;</text>
          </view>
          <view class='flex align-center recommendCommodityList_fd0_0_c1'>
            <image class='recommendCommodityList_fd0_0_c1_c0' mode="aspectFit" :src='STATIC_URL+"195.png"'></image>
            <input class='recommendCommodityList_fd0_0_c1_c1' type="text" :placeholder="`搜索`" confirm-type="done"
              :maxlength="-1" placeholder-style="color:#999;font-size:28rpx" />
            <image class='recommendCommodityList_fd0_0_c1_c2' mode="aspectFit" :src='STATIC_URL+"196.png"'
              v-if=" keyword!=''"></image>
          </view>
        </view>

      </view>
      <view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
      <!---flex布局flex布局开始-->
      <view class="flex benben-flex-layout flex-wrap align-center">
        <view>
          <benben-flex-tabs class-name='recommendCommodityList_benbenTabsfd1_0' v-model="types" ref="benben_tabsfd1_0"
            select-mark="benben_tabsfd1_0" key="benben_tabsfd1_0" :open-title-type='false' :open-sticky='true' :top='0'
            :is-show-content='false' :scrollspy='false' :tabs-info.sync="tabsInfofd1_0">

            <scroll-view @scroll="tabsInfofd1_0.scrollX = $event.detail.scrollLeft" id="benben_tabsfd1_0"
              class="benben-tabs" style="width:750rpx" :scroll-x="true" :scroll-left.sync="tabsInfofd1_0.moveX"
              scroll-with-animation="all .3s ease">
              <view class="benben-tabs-content" id="benben_tabsfd1_0-content">
                <view id="benben_tabsfd1_0-title" class="benben-tabs-title flex align-center flex ">
                  <view
                    :class="{ 'checkTitlefd1_0': types == '1', 'flex flex-wrap align-center recommendCommodityList_titlefd1_0_c3': true }"
                    @tap="types = '1'" :id="`benben_tabsfd1_0-title-item-${'1'}`">

                    <text>我要求助</text>

                  </view>
                  <view
                    :class="{ 'checkTitlefd1_0': types == '2', 'flex flex-wrap align-center recommendCommodityList_titlefd1_0_c4': true }"
                    @tap="types = '2'" :id="`benben_tabsfd1_0-title-item-${'2'}`">

                    <text>我来帮扶</text>

                  </view>
                  <view
                    :class="{ 'checkTitlefd1_0': types == '3', 'flex flex-wrap align-center recommendCommodityList_titlefd1_0_c4': true }"
                    @tap="types = '3'" :id="`benben_tabsfd1_0-title-item-${'3'}`">

                    <text>会员生活</text>

                  </view>
                  <view :class="{ 'checkTitlefd1_0': types == '4', 'flex flex-wrap align-center': true }"
                    @tap="types = '4'" :id="`benben_tabsfd1_0-title-item-${'4'}`">

                  </view>
                </view>
                <view :style="{ left: tabsInfofd1_0.lineleft, maxWidth: tabsInfofd1_0.lineWidth ,}"
                  id="benben_tabsfd1_0-line"
                  class="benben-tabs-line flex benben-flex-tabs-line recommendCommodityList_linefd1_0"></view>
              </view>
            </scroll-view>

          </benben-flex-tabs>

        </view>
      </view>

      <!---flex布局flex布局结束-->
      <!---flex布局flex布局开始-->
      <view class="flex flex-direction flex-wrap align-stretch benben-flex-layout recommendCommodityList_flex_2">
        <view class='flex flex-wrap align-center justify-between recommendCommodityList_fd2_0'>
          <view class='flex flex-direction flex-wrap align-stretch recommendCommodityList_fd2_0_c0'>
            <view class='flex flex-wrap align-center recommendCommodityList_fd2_0_c0_c0'>
              <view class='flex align-center self-center recommendCommodityList_fd2_0_c0_c0_c0'>
                <image class='recommendCommodityList_fd2_0_c0_c0_c0_c0' mode="aspectFit" :src='STATIC_URL+"500.png"'>
                </image>
                <text class='recommendCommodityList_fd2_0_c0_c0_c0_c1'>西安市</text>
              </view>
              <image class='recommendCommodityList_fd2_0_c0_c0_c1' mode="aspectFit" :src='STATIC_URL+"501.png"'></image>
              <image class='recommendCommodityList_fd2_0_c0_c0_c2' mode="aspectFill" :src='STATIC_URL+"346.png"'>
              </image>
            </view>
            <view class='recommendCommodityList_fd2_0_c0_c1'>
              <text class='recommendCommodityList_fd2_0_c0_c1_c0' v-if=" type=='1'">线上</text><text
                class='recommendCommodityList_fd2_0_c0_c1_c0_1' v-if=" type=='2'">线上</text>
              <text class='recommendCommodityList_fd2_0_c0_c1_c1'>星愿救助站，流浪猫流浪狗领养</text>
            </view>
            <view class='flex flex-wrap align-center recommendCommodityList_fd2_0_c0_c2'>
              <text class='recommendCommodityList_fd2_0_c0_c2_c0'>¥</text>
              <text class=' recommendCommodityList_fd2_0_c0_c2_c1'>
                <text class=' recommendCommodityList_price1_fd2_0_c0_c2_c1'>{{ 100 | frontPrice('w') }}</text>
                <text class=' recommendCommodityList_price2_fd2_0_c0_c2_c1'>{{ 100 | laterPrice('w') }}</text>
              </text>
            </view>
            <view class='flex flex-wrap align-center self-center recommendCommodityList_fd2_0_c0_c3'>
              <image class='recommendCommodityList_fd2_0_c0_c3_c0' mode="aspectFit" :src='STATIC_URL+"297.jpg"'></image>
              <text class='recommendCommodityList_fd2_0_c0_c3_c1'>小恩与法时空</text>
            </view>
          </view>
        </view>
      </view>

      <!---flex布局flex布局结束-->


    </view>
  </view>
</template>
<script>
  import pagingList from '@/common/mixin/paging_list.js';
  import {
    validate
  } from '@/common/utils/validate.js'
  export default {
    components: {},
    mixins: [pagingList],

    data() {
      return {
        "tabsInfofd1_0": {
          lineleft: '',
          lineWidth: '',
          moveX: 0,
          scrollX: 0,
          PageScrollX: 0
        },
        "minixPagingListsApi": "",
        "pageingListApiMethod": "",
        "allowOnloadGetList": false,
        "allType": [{
          "name": "全部",
          "value": "0",
          "image": ""
        }, {
          "name": "最新",
          "value": "1",
          "image": ""
        }, {
          "name": "最热",
          "value": "2",
          "image": ""
        }],
        "all_id": "0",
        "allshow": false,
        "all_name": "全部",
        "screenType": [{
          "name": "推荐",
          "value": "1",
          "image": ""
        }, {
          "name": "视频",
          "value": "2",
          "image": ""
        }, {
          "name": "图文",
          "value": "3",
          "image": ""
        }],
        "screen_id": "1",
        "screenshow": false,
        "show_id": "1",
        "dataList": [],
        "userList": [],
        "is_recommend": "",
        "grass_type": "",
        "types": "1",
        "type": "1",
        "keyword": "",
        "cid": ""
      };
    },
    computed: {
      themeColor() {
        return this.$store.getters.themeColor
      },

    },
    watch: {},
    onLoad(options) {
      let {
        keyword,
        cid
      } = options
      if (keyword !== undefined) this.keyword = keyword
      if (cid !== undefined) this.cid = cid
    },
    onUnload() {

    },
    onReady() {

    },
    onShow() {

    },
    onHide() {

    },
    onResize() {

    },
    onPullDownRefresh() {

    },
    onReachBottom(e) {

    },
    onPageScroll(e) {

    },
    methods: {
      //是否显示显示全部下拉弹窗
      showallFunc() {
        if (this.allshow === true) {
          this.allshow = false;
        } else {
          this.allshow = true;
          this.getPostlistFunc()
        }
        if (this.show_id == '2') {
          this.show_id = '1';
        }
      },
      //是否显示筛选弹窗
      isscreenshowFunc() {
        if (this.screenshow === true) {
          this.screenshow = false;
        } else {
          this.screenshow = true;
        }
      },
      //切换类型
      switchTypeFunc() {
        if (this.show_id == '1') {
          this.show_id = '2';
        } else {
          this.show_id = '1';
        }
      },
      //获取帖子列表
      getPostlistFunc() {
        this.minixPagingListsApi = global.apiUrls.post64448e18f032c;
        this.pageingListApiMethod = 'post';
        this.allowOnloadGetList = false;
        this.pagingListPostDataContent = {
          is_recommend: this.is_recommend,
          grass_type: this.grass_type,
          keywords: this.keyword,
          sort: this.all_id
        }
        this.listData = [];
        this.dataList = this.listData;
        this.pagingListToggle();

      },
      //获取用户列表
      getUserListFunc() {
        this.minixPagingListsApi = global.apiUrls.post6444ed555bf69;
        this.pageingListApiMethod = 'post';
        this.allowOnloadGetList = false;
        this.pagingListPostDataContent = {
          keywords: this.keyword
        }
        this.listData = [];
        this.userList = this.listData;
        this.pagingListToggle();

      },
      //搜索
      searchFunc() {
        if (this.show_id == '2') {
          this.getUserListFunc()
        } else {
          this.getPostlistFunc()
        }
      },
      //点击完成
      accomplishFunc() {
        if (this.screen_id == '1') {
          this.is_recommend = '1';
          this.grass_type = '';
        } else if (this.screen_id == '2') {
          this.grass_type = '1';
          this.is_recommend = '';
        } else {
          this.grass_type = '2';
          this.is_recommend = '';
        }
        this.getPostlistFunc()
        this.screenshow = false;
      },
      pagingListPostData() {
        return this.pagingListPostDataContent
      }
    }
  };
</script>
<style lang="scss" scoped>
  .page {
    width: 100vw;
    overflow-x: hidden;
    min-height: calc(100vh - var(--window-bottom));
    background: var(--benbenbgColor1);
    background-size: 100% auto;
  }

  .recommendCommodityList_flex_0 {
    background: #fff;
    width: 750rpx;
    height: 88rpx;
    overflow: hidden;
    z-index: 10;
    top: 0rpx;
    background-size: 100% auto !important;
  }

  .recommendCommodityList_fd0_0_c1_c2 {
    width: 28rpx;
    height: 28rpx;
    border-radius: 0rpx 0rpx 0rpx 0rpx;
  }

  .recommendCommodityList_fd0_0_c1_c1 {
    margin: 0rpx 0rpx 0rpx 16rpx;
  }

  .recommendCommodityList_fd0_0_c1_c0 {
    width: 24rpx;
    height: 24rpx;
    border-radius: 0rpx 0rpx 0rpx 0rpx;
  }

  .recommendCommodityList_fd0_0_c1 {
    background: rgba(249, 249, 249, 1);
    background-size: 100% auto !important;
    border-radius: 34rpx 34rpx 34rpx 34rpx;
    margin: 0rpx 0rpx 0rpx 24rpx;
    padding: 0rpx 24rpx 0rpx 24rpx;
    height: 64rpx;
    width: 440rpx;
  }

  .recommendCommodityList_fd0_0_c0_c0 {
    font-size: 36rpx;
    font-weight: 500;
    color: #333;
  }

  .recommendCommodityList_fd0_0 {
    padding: 0rpx 24rpx 0rpx 24rpx;
    line-height: 88rpx;
  }

  .recommendCommodityList_titlefd1_0_c4 {
    margin: 0rpx 0rpx 0rpx 64rpx;
  }

  .recommendCommodityList_titlefd1_0_c3 {
    margin: 0rpx 0rpx 0rpx 32rpx;
  }

  .recommendCommodityList_linefd1_0 {
    background: url(image-path('502.png')) no-repeat;
    width: 109rpx;
    height: 10rpx;
    top: 60rpx;
    background-size: 100% auto !important;
  }

  .checkTitlefd1_0 {
    font-weight: 700 !important;
    font-size: 28rpx !important;
    color: #333 !important;
    background-color: rgba(255, 255, 255, 1) !important;
  }

  ::v-deep .recommendCommodityList_benbenTabsfd1_0 {
    border-bottom: 1px solid rgba(238, 238, 238, 1);
    background: var(--benbenbgColor1);
    width: 750rpx;
    height: 104rpx;
    white-space: nowrap;
    text-align: center;
    font-size: 28rpx;
    font-weight: 500;
    color: #666666;
  }

  .recommendCommodityList_flex_2 {
    padding: 0rpx 24rpx 0rpx 24rpx;
  }

  .recommendCommodityList_fd2_0_c0_c3_c1 {
    color: #333333;
    font-size: 24rpx;
    font-weight: 400;
    margin: 0rpx 0rpx 0rpx 16rpx;
  }

  .recommendCommodityList_fd2_0_c0_c3_c0 {
    width: 40rpx;
    height: 40rpx;
    border-radius: 100rpx;
  }

  .recommendCommodityList_fd2_0_c0_c3 {
    padding: 0rpx 8rpx 0rpx 8rpx;
  }

  .recommendCommodityList_price2_fd2_0_c0_c2_c1 {
    font-size: 28rpx;
  }

  .recommendCommodityList_price1_fd2_0_c0_c2_c1 {
    font-size: 32rpx;
  }

  .recommendCommodityList_fd2_0_c0_c2_c1 {
    color: rgba(204, 0, 0, 1);
    font-weight: 700;
    font-size: 20rpx;
    line-height: 28rpx;
    margin: 6rpx 0rpx 0rpx 0rpx;
  }

  .recommendCommodityList_fd2_0_c0_c2_c0 {
    color: rgba(204, 0, 0, 1);
    font-weight: 600;
    line-height: 28rpx;
  }

  .recommendCommodityList_fd2_0_c0_c2 {
    margin: 16rpx 20rpx 12rpx 20rpx;
  }

  .recommendCommodityList_fd2_0_c0_c1_c1 {
    color: #333333;
    font-size: 28rpx;
    font-weight: 700;
    margin: 0rpx 0rpx 0rpx 12rpx;
  }

  .recommendCommodityList_fd2_0_c0_c1_c0_1 {
    border: 0.5px solid rgba(235, 55, 55, 1);
    background: #FEEFEF;
    width: 64rpx;
    height: 32rpx;
    line-height: 32rpx;
    background-size: 100% auto;
    color: rgba(235, 55, 55, 1);
    font-size: 22rpx;
    padding: 5rpx 8rpx 5rpx 8rpx;
    border-radius: 8rpx;
  }

  .recommendCommodityList_fd2_0_c0_c1_c0 {
    border: 0.5px solid rgba(34, 135, 236, 1);
    background: rgba(228, 240, 253, 1);
    width: 64rpx;
    height: 32rpx;
    line-height: 32rpx;
    background-size: 100% auto;
    color: var(--benbenFontColor4);
    font-size: 22rpx;
    padding: 5rpx 8rpx 5rpx 8rpx;
    border-radius: 8rpx;
  }

  .recommendCommodityList_fd2_0_c0_c1 {
    padding: 8rpx 8rpx 0rpx 8rpx;
  }

  .recommendCommodityList_fd2_0_c0_c0_c2 {
    width: 344rpx;
    height: 346rpx;
    border-radius: 16rpx 16rpx 0rpx 0rpx;
  }

  .recommendCommodityList_fd2_0_c0_c0_c1 {
    width: 36rpx;
    height: 36rpx;
    border-radius: 0rpx;
    position: absolute;
    z-index: 9;
    right: 16rpx;
    top: 16rpx;
  }

  .recommendCommodityList_fd2_0_c0_c0_c0_c1 {
    color: #FFFFFF;
    font-size: 22rpx;
    font-weight: 400;
  }

  .recommendCommodityList_fd2_0_c0_c0_c0_c0 {
    width: 20rpx;
    height: 24rpx;
    border-radius: 0rpx 0rpx 0rpx 0rpx;
    margin: 0rpx 8rpx 0rpx 0rpx;
  }

  .recommendCommodityList_fd2_0_c0_c0_c0 {
    background: rgba(0, 0, 0, 0.4);
    position: absolute;
    bottom: 0rpx;
    z-index: 99;
    border-radius: 12rpx 12rpx 12rpx 0rpx;
    height: 40rpx;
    padding: 0rpx 10rpx 0rpx 10rpx;
  }

  .recommendCommodityList_fd2_0_c0_c0 {
    position: relative;
  }

  .recommendCommodityList_fd2_0_c0 {
    background: #FFFFFF;
    border-radius: 16rpx 16rpx 16rpx 16rpx;
    margin: 0rpx 0rpx 20rpx 0rpx;
    padding: 0rpx 0rpx 24rpx 0rpx;
    box-shadow: 0rpx 3rpx 30rpx #E8E8E8;
    width: 344rpx;
  }

  .recommendCommodityList_fd2_0 {
    margin: 37rpx 0rpx 0rpx 0rpx;
  }
</style>